/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Registro.java
 *
 * Created on 6/05/2009, 11:04:41 PM
 */
package gui;

import conexion.RmiServidor;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.xml.parsers.ParserConfigurationException;
import org.jvnet.substance.SubstanceLookAndFeel;
import org.jvnet.substance.watermark.SubstanceImageWatermark;
import org.xml.sax.SAXException;

/**
 *
 * @author arquitectura
 */
public class HomeAdmin extends javax.swing.JFrame {
    private RmiServidor rs;
    private EstadoServidor hs;
    private VerPerfilAdmin vp;
    /** Creates new form Registro */
    public HomeAdmin(RmiServidor rs) {
        initComponents();

        this.setSize(800, 625);
        this.setLocationRelativeTo(null);
        this.rs=rs;

    }

    public JButton getBTN_bloquearUsuario() {
        return BTN_bloquearUsuario;
    }

    public void setBTN_bloquearUsuario(JButton BTN_bloquearUsuario) {
        this.BTN_bloquearUsuario = BTN_bloquearUsuario;
    }

    public JButton getBTN_eliminarUsuario() {
        return BTN_eliminarUsuario;
    }

    public void setBTN_eliminarUsuario(JButton BTN_eliminarUsuario) {
        this.BTN_eliminarUsuario = BTN_eliminarUsuario;
    }

    public JButton getBTN_salir() {
        return BTN_salir;
    }

    public void setBTN_salir(JButton BTN_salir) {
        this.BTN_salir = BTN_salir;
    }

    public JButton getBTN_verPerfil() {
        return BTN_verPerfil;
    }

    public void setBTN_verPerfil(JButton BTN_verPerfil) {
        this.BTN_verPerfil = BTN_verPerfil;
    }

 
    

    public JScrollPane getJScrollPane1() {
        return jScrollPane1;
    }

    public void setJScrollPane1(JScrollPane jScrollPane1) {
        this.jScrollPane1 = jScrollPane1;
    }

    public JScrollPane getJScrollPane2() {
        return jScrollPane2;
    }

    public void setJScrollPane2(JScrollPane jScrollPane2) {
        this.jScrollPane2 = jScrollPane2;
    }

    public JScrollPane getJScrollPane3() {
        return jScrollPane3;
    }

    public void setJScrollPane3(JScrollPane jScrollPane3) {
        this.jScrollPane3 = jScrollPane3;
    }

    public JTextArea getJtChat() {
        return jtChat;
    }

    public void setJtChat(JTextArea jtChat) {
        this.jtChat = jtChat;
    }

    public JTextArea getJtPartidas() {
        return jtPartidas;
    }

    public void setJtPartidas(JTextArea jtPartidas) {
        this.jtPartidas = jtPartidas;
    }

    public JTextArea getJtUsuarios() {
        return jtUsuarios;
    }

    public void setJtUsuarios(JTextArea jtUsuarios) {
        this.jtUsuarios = jtUsuarios;
    }

    public RmiServidor getRs() {
        return rs;
    }

    public void setRs(RmiServidor rs) {
        this.rs = rs;
    }

 

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        BTN_eliminarUsuario = new javax.swing.JButton();
        BTN_bloquearUsuario = new javax.swing.JButton();
        BTN_verPerfil = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtUsuarios = new javax.swing.JTextArea();
        jScrollPane2 = new javax.swing.JScrollPane();
        jtPartidas = new javax.swing.JTextArea();
        jScrollPane3 = new javax.swing.JScrollPane();
        jtChat = new javax.swing.JTextArea();
        BTN_salir = new javax.swing.JButton();
        BTN_habilitarServidor = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBounds(new java.awt.Rectangle(0, 0, 0, 0));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setForeground(java.awt.Color.white);
        setMinimumSize(new java.awt.Dimension(800, 625));
        setResizable(false);
        setUndecorated(true);

        BTN_eliminarUsuario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/BTN_elimusu.png"))); // NOI18N
        BTN_eliminarUsuario.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        BTN_eliminarUsuario.setBorderPainted(false);
        BTN_eliminarUsuario.setContentAreaFilled(false);
        BTN_eliminarUsuario.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/BTN_elimusu_roll.png"))); // NOI18N
        BTN_eliminarUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTN_eliminarUsuarioActionPerformed(evt);
            }
        });

        BTN_bloquearUsuario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/BTN_bloquearusu.png"))); // NOI18N
        BTN_bloquearUsuario.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        BTN_bloquearUsuario.setBorderPainted(false);
        BTN_bloquearUsuario.setContentAreaFilled(false);
        BTN_bloquearUsuario.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/BTN_bloquearusu_roll.png"))); // NOI18N
        BTN_bloquearUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTN_bloquearUsuarioActionPerformed(evt);
            }
        });

        BTN_verPerfil.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/BTN_verperfil.png"))); // NOI18N
        BTN_verPerfil.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        BTN_verPerfil.setBorderPainted(false);
        BTN_verPerfil.setContentAreaFilled(false);
        BTN_verPerfil.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/BTN_verperfil_roll.png"))); // NOI18N
        BTN_verPerfil.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTN_verPerfilActionPerformed(evt);
            }
        });

        jtUsuarios.setColumns(20);
        jtUsuarios.setRows(5);
        jScrollPane1.setViewportView(jtUsuarios);

        jtPartidas.setColumns(20);
        jtPartidas.setRows(5);
        jScrollPane2.setViewportView(jtPartidas);

        jtChat.setColumns(20);
        jtChat.setRows(5);
        jScrollPane3.setViewportView(jtChat);

        BTN_salir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/BTN_cancelar.png"))); // NOI18N
        BTN_salir.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        BTN_salir.setBorderPainted(false);
        BTN_salir.setContentAreaFilled(false);
        BTN_salir.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/BTN_cancelar_roll.png"))); // NOI18N
        BTN_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTN_salirActionPerformed(evt);
            }
        });

        BTN_habilitarServidor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/BTN_habilitarservidor.png"))); // NOI18N
        BTN_habilitarServidor.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        BTN_habilitarServidor.setBorderPainted(false);
        BTN_habilitarServidor.setContentAreaFilled(false);
        BTN_habilitarServidor.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/gui/BTN_habilitarservidor_roll.png"))); // NOI18N
        BTN_habilitarServidor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTN_habilitarServidorActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(29, 29, 29)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(BTN_verPerfil, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(BTN_eliminarUsuario)
                                    .addComponent(BTN_bloquearUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(155, 155, 155)
                                .addComponent(BTN_habilitarServidor))))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(41, 41, 41)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(28, 28, 28)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(32, 32, 32)
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 201, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(50, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(725, Short.MAX_VALUE)
                .addComponent(BTN_salir, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(37, 37, 37))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(51, 51, 51)
                .addComponent(BTN_salir, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(108, 108, 108)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(70, 70, 70)
                        .addComponent(BTN_habilitarServidor))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 37, Short.MAX_VALUE)
                        .addComponent(BTN_eliminarUsuario)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(BTN_bloquearUsuario)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(BTN_verPerfil)))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void BTN_eliminarUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTN_eliminarUsuarioActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_BTN_eliminarUsuarioActionPerformed

    private void BTN_bloquearUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTN_bloquearUsuarioActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_BTN_bloquearUsuarioActionPerformed

    private void BTN_verPerfilActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTN_verPerfilActionPerformed
        try {
            // TODO add your handling code here:
            this.setVisible(false);
            JFrame.setDefaultLookAndFeelDecorated(true);

    SubstanceLookAndFeel.setSkin("org.jvnet.substance.skin.CremeSkin");
    //SubstanceLookAndFeel.setCurrentWatermark("org.jvnet.substance.watermark.SubstanceBinaryWatermark");//Ejemplo de aplicacion de un watermark de Substance
    SubstanceLookAndFeel.setCurrentWatermark(new SubstanceImageWatermark("http://72.29.81.246/~imindjav/images/VerPerfilAdmin.jpg"));
    SubstanceLookAndFeel.setImageWatermarkOpacity(new Float(1));
            vp = new VerPerfilAdmin(this);
            vp.setVisible(true);
        } catch (ParserConfigurationException ex) {//GEN-LAST:event_BTN_verPerfilActionPerformed
            Logger.getLogger(HomeAdmin.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SAXException ex) {
            Logger.getLogger(HomeAdmin.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(HomeAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void BTN_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTN_salirActionPerformed
        // TODO add your handling code here:
        rs.salirSistema();
}//GEN-LAST:event_BTN_salirActionPerformed

    private void BTN_habilitarServidorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTN_habilitarServidorActionPerformed
        // TODO add your handling code here:
        this.setVisible(false);
        SubstanceLookAndFeel.setSkin("org.jvnet.substance.skin.CremeSkin");
        //SubstanceLookAndFeel.setCurrentWatermark("org.jvnet.substance.watermark.SubstanceBinaryWatermark");//Ejemplo de aplicacion de un watermark de Substance
        SubstanceLookAndFeel.setCurrentWatermark(new SubstanceImageWatermark("http://72.29.81.246/~imindjav/images/EstadoServidor.jpg"));
        SubstanceLookAndFeel.setImageWatermarkOpacity(new Float(1));
        hs = new EstadoServidor(rs, this);
        hs.setVisible(true);
    }//GEN-LAST:event_BTN_habilitarServidorActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {

        JFrame.setDefaultLookAndFeelDecorated(true);

        SubstanceLookAndFeel.setSkin("org.jvnet.substance.skin.CremeSkin");
        //SubstanceLookAndFeel.setCurrentWatermark("org.jvnet.substance.watermark.SubstanceBinaryWatermark");//Ejemplo de aplicacion de un watermark de Substance
        SubstanceLookAndFeel.setCurrentWatermark(new SubstanceImageWatermark("http://72.29.81.246/~imindjav/images/HomeAdmin.jpg"));
        SubstanceLookAndFeel.setImageWatermarkOpacity(new Float(1));
/*
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new HomeAdmin().setVisible(true);
            }
        });*/
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BTN_bloquearUsuario;
    private javax.swing.JButton BTN_eliminarUsuario;
    private javax.swing.JButton BTN_habilitarServidor;
    private javax.swing.JButton BTN_salir;
    private javax.swing.JButton BTN_verPerfil;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTextArea jtChat;
    private javax.swing.JTextArea jtPartidas;
    private javax.swing.JTextArea jtUsuarios;
    // End of variables declaration//GEN-END:variables
}
